import React, { PureComponent } from 'react'
import { AppWrapper, SectionWrapper } from './style'

export class App extends PureComponent {
  constructor() {
    super()
    this.state = {
      size: 30,
      color: '#999'
    }
  }

  changeColor() {
    this.setState({
      color: '#000'
    })
  }

  render() {
    const { size, color } = this.state
    return (
      <AppWrapper>
        <SectionWrapper size={size} color={color}>
          <div className="title">标题</div>
          <div className="content">内容</div>
          <button onClick={() => this.changeColor()}>修改颜色</button>
        </SectionWrapper>
        <div className="footer">
          <p>免责声明</p>
        </div>
      </AppWrapper>
    )
  }
}

export default App